﻿// need km.core.js
if (typeof $.WuDada == "undefined") {
    $.blockUI({ message: "Error: wudada.dataloadservice must be load wudada.core.js. <input type='button' value='OK' onclick='$.unblockUI();'>" });
}

(function($) {
    $.WuDada.DataLoadService = {
        //DataLoadServiceUrl: "/Service/service_dataloadservice.ashx",
        DataLoadServiceUrl: "/TradeCenterWeb/Service/service_dataloadservice.ashx",

        GetUrl: function() {
            return $.WuDada.Core.RootUrl + this.DataLoadServiceUrl;
        },      
        CreateStockData: function(stockData, callBack) {            
            var param = "cmd=createstockdata&stockCode=" + encodeURIComponent(stockData.stockCode) 
                + "&period=" + encodeURIComponent(stockData.period)
                + "&dataTime=" + encodeURIComponent(stockData.dataTime) 
                + "&openValue=" + encodeURIComponent(stockData.openValue)
                + "&highValue=" + encodeURIComponent(stockData.highValue)
                + "&lowValue=" + encodeURIComponent(stockData.lowValue) 
                + "&closeValue=" + encodeURIComponent(stockData.closeValue) 
                + "&volumeValue=" + encodeURIComponent(stockData.volumeValue) ;
            $.WuDada.Core.Post(this.GetUrl(), param, callBack);
        },        
    };
})(jQuery);

